package org.tacademy.remoteservice;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

public class CalcService extends Service {

	@Override
	public IBinder onBind(Intent intent) {
		return binder;
	}
	
	ICalc.Stub binder = new ICalc.Stub() {
		
		public boolean isPrime(int n) throws RemoteException {
			int i;
			for(i=2; i<n; i++){
				if(n%i==0)	return false;
				return true;
			}
			return false;
		}
		
		public int getAdd(int a, int b) throws RemoteException {
			return a+b;
		}
	};
}
